package com.teapos.enumtype;

public enum JobEnum {
	
	HEAD(1, "主管"),
	SALES(2, "销售"),
	MARKET(3, "市场部"),
	MARKETHEAD(4, "市场部经理"),
	WAREHOUSE(5, "库管"),
	LEADER(6, "总管"),
	OFFICER(7, "运营总监"),
	CEO(8, "执行总监");
	
	private int code;
	private String desc;
	private JobEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static JobEnum getEnumByCode(int code) {
		JobEnum[] enums = JobEnum.values();
		for(JobEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
